Make and view annual time-series data as 3-band composite¶

Basic Parameters: 
 PrintDate = 2023-06-19 
 gridCell = 4057 
 index_dir = /home/downspout-cel/paraguay_lc/stac/grids/004057/brdf_ts/ms/evi2 
 out_dir = /home/klwalker/data/tmp 
 spec_index= evi2
Single Plot Parameters: 
 plot_yr = 2010
Shapefile = point 
 If point, file is /home/klwalker/data/tmp/SelectedCoords.csv 
 If poly, file is /home/downspout-cel/paraguay_lc/vector/TestPolys/YerbaMatte_GEpolysEE.shp 
 input crs = epsg:8858
startYr = 2010 
 endYr = 2011

Current options for composite bands are:¶

  • Avg (mean)
  • Max (maximum index value)
  • Min (minumum index value)
  • Amp (Max - Min)
  • Std (standard deviation)
  • CV (coefficient of variation: std/mean)
  • MaxDate (day of year on which maximum occurs)
  • MaxDateCos (cosine of max date, to reduce periodic effect)
  • MinDate (day of year on which minimum occurs)
  • MinDateCos (cosine of min date, to reduce periodic effect)

  • Jan (value from Jan 10th image)
  • Apr (value from Apr 10th image)
  • Jun (value from Jun 10th image)
  • Aug (value from Aug 10th image)
  • Nov (value from Nov 10th image)

note: if running many these, use bash script "MakeTScomposite.sh" to run on job node of cluster¶

Make ['Min','Max','Amp'] composite to highlight crops vs grassland/forest¶

22:55:45:INFO:1044:io.to_raster:  Creating the file ...

22:55:46:INFO:1051:io.to_raster:  Writing data to file ...

22:55:46:INFO:1074:io.to_raster:  Windows 1--16 of 16 ...
['Min', 'Max', 'Amp']
making max raster
100%|███████████████████████████████████████████| 16/16 [00:04<00:00,  3.50it/s]
22:55:50:INFO:1380:io.to_raster:
Finished writing the data.
22:55:50:INFO:1044:io.to_raster:  Creating the file ...

22:55:50:INFO:1051:io.to_raster:  Writing data to file ...

22:55:50:INFO:1074:io.to_raster:  Windows 1--16 of 16 ...
making min raster
100%|███████████████████████████████████████████| 16/16 [00:02<00:00,  6.81it/s]
22:55:53:INFO:1380:io.to_raster:
Finished writing the data.
22:55:53:INFO:1044:io.to_raster:  Creating the file ...

22:55:53:INFO:1051:io.to_raster:  Writing data to file ...

22:55:53:INFO:1074:io.to_raster:  Windows 1--16 of 16 ...
making amp raster
100%|███████████████████████████████████████████| 16/16 [00:02<00:00,  5.97it/s]
22:55:56:INFO:1380:io.to_raster:
Finished writing the data.
['/home/klwalker/data/tmp/Max.tif', '/home/klwalker/data/tmp/Min.tif', '/home/klwalker/data/tmp/Amp.tif']

Non-interactive image with enhanced colors:¶

Interactive image (to query points for timeseries profile)¶

click on map to get coordinates to query (can zoom in first)
[[-25.899651140190034, -54.82558107236401]]
[[-25.899651140190034, -54.82558107236401], [-25.898647407328127, -54.81184816220777]]
[[-25.899651140190034, -54.82558107236401], [-25.898647407328127, -54.81184816220777], [-25.89756645469786, -54.80051851132886]]
[[-25.899651140190034, -54.82558107236401], [-25.898647407328127, -54.81184816220777], [-25.89756645469786, -54.80051851132886], [-25.902353455456915, -54.791506289038814]]
3208080.599 -3270059.397
3209345.530 -3269937.226
3210392.236 -3269805.656
3211154.921 -3270388.310
1: 6547/6361/186
2: 1432/1097/335
3: 4497/4440/57
4: 4474/2494/1980

Get time series for pts¶

working on cell 4057
grid is in:  epsg:8858
                                            geometry
0  POLYGON ((3218830.886 -3279608.696, 3218830.88...
Of the 4 ppts, 4 are in gridCell 4057
getting index values...
                           geometry  2010152  2010161  2010171  2010182  \
0  POINT (3208080.599 -3270059.397)     6361     6361     6361     6361   
1  POINT (3209345.530 -3269937.226)     1440     1437     1435     1432   
2  POINT (3210392.236 -3269805.656)     4474     4473     4472     4472   
3  POINT (3211154.921 -3270388.310)     2384     2409     2437     2465   

   2010191  2010201  2010213  2010222  2010232  ...  2011051  2011060  \
0     6361     6361     6361     6361     6362  ...     6400     6409   
1     1429     1426     1423     1420     1417  ...     1298     1282   
2     4471     4471     4470     4470     4469  ...     4441     4441   
3     2494     2522     2551     2581     2611  ...     3482     3536   

   2011069  2011079  2011091  2011100  2011110  2011121  2011130  2011140  
0     6419     6430     6442     6455     6468     6482     6497     6511  
1     1266     1248     1229     1208     1188     1169     1150     1133  
2     4440     4441     4443     4446     4453     4459     4465     4472  
3     3584     3639     3711     3774     3871     3962     4042     4126  

[4 rows x 37 columns]
working on cell 4057
grid is in:  epsg:8858
                                            geometry
0  POLYGON ((3218830.886 -3279608.696, 3218830.88...
Of the 4 ppts, 4 are in gridCell 4057
getting index values...
                           geometry      2010183      2010231      2010263  \
0  POINT (3208080.599 -3270059.397)  5459.881366     0.000000  2037.562013   
1  POINT (3209345.530 -3269937.226)  6117.524294     0.000000  1372.192934   
2  POINT (3210392.236 -3269805.656)  4231.705857  2299.127276  2376.438116   
3  POINT (3211154.921 -3270388.310)  4719.665391     0.000000  1732.470454   

       2010279      2010311      2010327      2011010      2011026  2011042  \
0  1015.853746  1488.283279  3303.677515  7436.147624  7429.734803      NaN   
1  1527.983790  1475.723591  2535.776879  7816.704843  7787.422208      NaN   
2  3598.813175  4087.714936  4200.739689     0.000000  5511.938406      NaN   
3  2297.767363  1264.615340  2861.773346  7396.325831  7418.820411      NaN   

   ...  2010351  2011002  2011018  2011034      2011050      2011066  \
0  ...      0.0      0.0      NaN      0.0  3087.915174  1100.298386   
1  ...      0.0      0.0      NaN      0.0  6339.226846  2065.649587   
2  ...      0.0      0.0      NaN      0.0  5027.723268  5852.219198   
3  ...      0.0      0.0      NaN      0.0  5175.456458  1458.623650   

       2011082      2011098  2010303      2011114  
0  1795.329457  4305.043050      NaN  1734.686147  
1  1406.467536  1333.087397      NaN     0.000000  
2     0.000000  5906.987355      NaN  3858.674300  
3     0.000000  1282.033656      NaN  1246.662216  

[4 rows x 31 columns]

show output¶

Comp_4057_2010_pts.jpg

to show one point in more detiail:¶

Make ['Jan','Jun','Nov'] composite to see different crops¶

['Jan', 'Jun', 'Nov']
['/home/downspout-cel/paraguay_lc/stac/grids/004057/brdf_ts/ms/evi2/2010324.tif', '/home/downspout-cel/paraguay_lc/stac/grids/004057/brdf_ts/ms/evi2/2011020.tif', '/home/downspout-cel/paraguay_lc/stac/grids/004057/brdf_ts/ms/evi2/2011171.tif']

To save an html copy of this notebook with all outputs:¶

[NbConvertApp] Converting notebook 2b_ViewTimeSeriesComposite.ipynb to html
[NbConvertApp] Writing 4997084 bytes to Outputs/Paraguay2b_ViewTimeSeriesComposite_cell4057_2010.html
No filename set in app config or URL params. Using sample data.
No filename set in app config or URL params. Using sample data.
No filename set in app config or URL params. Using sample data.
No filename set in app config or URL params. Using sample data.
No filename set in app config or URL params. Using sample data.
No filename set in app config or URL params. Using sample data.
No filename set in app config or URL params. Using sample data.
No filename set in app config or URL params. Using sample data.
No filename set in app config or URL params. Using sample data.
No filename set in app config or URL params. Using sample data.
No filename set in app config or URL params. Using sample data.
No filename set in app config or URL params. Using sample data.